<!--
* @Description: 请假管理 - 表单
* @Author: DHL
* @Date: 2022-12-23 13:52:43
 * @LastEditors: DHL
 * @LastEditTime: 2022-12-23 15:25:56
-->
<template>
  <tw-dialog
    v-model="visible"
    :title="title"
    :loading="loading"
    width="1000px"
    height="500px"
    :scrollbar="false"
    @close="handleClose"
  >
    <tw-flow
      ref="flowRef"
      procDefKey="QJ"
      :businessKey="dbForm.id"
      @reset="handleReset"
      @submit="handleSubmit"
    >
      <el-form
        ref="dbFormRef"
        :model="dbForm"
        :rules="rules"
        label-width="90px"
        :disabled="action === 'view'"
      >
        <el-form-item label="名称" prop="name">
          <el-input v-model="dbForm.name" clearable placeholder="请输入名称"></el-input>
        </el-form-item>

        <el-form-item label="编码" prop="code">
          <el-input v-model="dbForm.code" clearable placeholder="请输入编码"></el-input>
        </el-form-item>

        <el-form-item label="类型" prop="type">
          <el-select v-model="dbForm.type" clearable placeholder="请选择类型">
            <tw-dic dicKey="OA_LEAVE_TYPE"></tw-dic>
          </el-select>
        </el-form-item>

        <el-form-item label="开始时间" prop="beginTime">
          <el-date-picker
            v-model="dbForm.beginTime"
            type="datetime"
            clearable
            placeholder="请选择开始时间"
            value-format="YYYY-MM-DD HH:mm:ss"
          ></el-date-picker>
        </el-form-item>

        <el-form-item label="结束时间" prop="endTime">
          <el-date-picker
            v-model="dbForm.endTime"
            type="datetime"
            clearable
            placeholder="请选择结束时间"
            value-format="YYYY-MM-DD HH:mm:ss"
          ></el-date-picker>
        </el-form-item>

        <el-form-item label="时长" prop="duration">
          <el-input-number v-model="dbForm.duration" clearable placeholder="请输入时长" />
        </el-form-item>

        <el-form-item label="事由" prop="because">
          <el-input v-model="dbForm.because" clearable placeholder="请输入事由"></el-input>
        </el-form-item>
      </el-form>
    </tw-flow>
  </tw-dialog>
</template>

<script src="./useForm.ts"></script>

<style scoped lang="scss"></style>
